Ext.define('HIT.store.MdataClientAddress', {
    extend: 'Ext.data.Store',

    requires: [
        'HIT.model.MdataClientAddress'
    ],

    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            autoLoad: false,
//            autoSync: true,
            storeId: 'MdataClientAddress',
            model: 'HIT.model.MdataClientAddress',
            pageSize: page_size,
            proxy: {
                type: 'ajax',
                url: 'getMdataClientAddressList',       
                reader: {
                    type: 'json'  ,
                    root: 'data'
                }
            }
//        ,listeners: {
//        	   beforeload: function(store){
//        		   var num = Ext.getCmp('mdata-client-main-panel').getSelectionModel().getSelection().length;
//        		   var MainInfo = Ext.getCmp('mdata-client-main-panel').getSelectionModel();
//        		   if(MainInfo.getSelection()[0] != undefined && MainInfo.getSelection()[0] != null && MainInfo.getSelection()[0] != '' ){
//        			   Ext.apply(store.proxy.extraParams, {mainId: num < 2 ? MainInfo.getSelection()[0].get('id') : ""});
//        		   }
//        	   }
//           }
        }, cfg)]);
    }
});